#ifndef __SECSMART_SESSION_H__
#define __SECSMART_SESSION_H__
#include "ip_addr.h"
#include <string>
#include <memory>

namespace secsmart_protocol{
    class ProtocolDetector;
}
namespace secsmart_session
{

typedef enum session_dirction {
    SESSION_DIRCTION_UNKNOW,
    SESSION_DIRCTION_REQUEST,
    SESSION_DIRCTION_RESPONSE
} session_dirction_t;

typedef enum dbDetectStatus{
    DATABASE_DETECTION_UNKNOWN,
    DATABASE_DETECTION_OK,
    DATABASE_DETECTION_ERROR
} dbDetectStatus_t;




typedef struct session {

    // 基本网络信息
    secsmart_tcpip::IPAddress sip;
    secsmart_tcpip::IPAddress dip;
    uint16_t sport;
    uint16_t dport;
    session_dirction_t direction;

    // db 信息
    uint16_t dbType;
    std::string dbVersion;
    dbDetectStatus_t detectSatus;


    uint8_t matchCount;
    uint8_t unknowPktCount;

    std::shared_ptr<secsmart_protocol::ProtocolDetector> detector = nullptr;
    
} session_t;

typedef std::shared_ptr<session_t> session_sptr;

}

#endif